<%@include file="/jsp/init.jspf" %>
<hunk:init enableAjaxForm="true"/>
<html>      
    <div id="divToUpdate"> update me </div>
    <script type="text/javascript">

        function bindForm(formId,updateToId){           
            var options = {
                target:     updateToId,
                url:        $(formId).attr("action"),
                success:    function() {
                    alert('Thanks for your comment!');
                }
            };
            // pass options to ajaxForm
            $(formId).ajaxForm(options);
        }

        $(document).ready(function() {
            bindForm('#myForm',"#divToUpdate");
        });
    </script>
</head>

<body>
    <form id="myForm" method="post" action="${path}/jsp/sample/rte.jsp">
        Name: <input type="text" name="name" />
        Comment: <textarea name="comment"></textarea>
        <input type="submit" value="Submit Comment"/>
    </form>
</body>
